home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 August / maximum-cd-2000-08.iso / Power Ware Feature / DOSLFNBK / DOSLFNBK.TXT < prev    next >
Encoding:
Text File  |  2000-01-16  |  37.7 KB  |  798 lines

  1. DOSLFNBK v 2.5 - Backs up/restores Win95 long filenames in DOS
  2.  
  3. Copyright (c) 1995,2000 D.J. Murdoch.
  4.  
  5. 0. Contents of this file
  6.  
  7.    1. Syntax
  8.    2. Description
  9.    3. Details
  10.    4. Memory Limitations
  11.    5. Safety
  12.    6. Recovery from Total Disk Failure
  13.    7. License
  14.    8. Release History
  15.    9. Acknowledgments
  16.  
  17. 1. Syntax:
  18.  
  19.       DOSLFNBK drive:directory [options]
  20.  
  21.         will back up all the long filename records in the named
  22.         directory and subdirectories of it to a file called
  23.         BACKUP.LFN.
  24.  
  25.       Options:
  26.         /all         Back up all filenames, not just LFNs and unusual
  27.                      attributes
  28.         /auto        Automatically accept the safe default without 
  29.                      prompting
  30.         /f filename  Back up to this file instead (default .LFN
  31.                      extension)
  32.         /force       Force DOSLFNBK to go ahead without asking questions,
  33.                      even when it may be unsafe
  34.         /from pathname  Restore names from this path
  35.         /h           Use high level disk access (backup only)
  36.         /l           List contents of backup file
  37.         /na          No attributes:  don't back up or restore attributes
  38.         /nf          No full restore check
  39.         /nr          No recursive:  don't do subdirectories
  40.         /nt          Don't restore times from LFN backup
  41.         /o           Always overwrite existing LFNs
  42.         /orphans     Go ahead if LFN damage is found
  43.         /p           Prompt before each filename restore (ignored
  44.                      during saves)
  45.         /q           Quieter restore             
  46.         /r           Restore from existing backup
  47.         /s directory Skip directory
  48.         /v           Give running status report
  49.         /d filename  Write a detailed debugging log to filename
  50.  
  51.       Examples:
  52.  
  53.         For recovery from a total disk failure, see section 6 below.
  54.  
  55.         To back up every long filename on the disk into BACKUP.LFN:
  56.  
  57.            doslfnbk c:\
  58.  
  59.         To restore just the Windows directory and subdirectories:
  60.  
  61.            doslfnbk c:\windows /r
  62.  
  63.         To restore just the root directory, but no subdirectories:
  64.  
  65.            doslfnbk c:\ /r /nr
  66.  
  67.         To backup everything except the MS Internet Explorer cache and
  68.         history directories:
  69.  
  70.    doslfnbk c:\ /s \progra~1\micros~1\cache /s \progra~1\micros~1\history
  71.  
  72.         To backup the current directory and subdirectories:
  73.  
  74.            doslfnbk .
  75.  
  76.         To restore the "Program Files" directory name and its
  77.         subdirectories, you need two runs:
  78.  
  79.            doslfnbk c:\PROGRA~1 /r
  80.            doslfnbk c:\ /r /p /nr
  81.  
  82.         On the second run, you'll be prompted for each name to restore;
  83.         just say yes when you see "Program Files".
  84.  
  85.         To see what filenames in the "Program Files" directory and its
  86.         subdirectories are in the current BACKUP.LFN file:
  87.  
  88.            doslfnbk c:\PROGRA~1 /l
  89.  
  90.         To restore names from files that were originally in
  91.         D:\OriginalDir (short name \ORIGIN~1) but which are now in
  92.         E:\CurrentDir:
  93.  
  94.            doslfnbk e:\CurrentDir /r /from \ORIGIN~1
  95.  
  96.         To get a listing of every file on your disk, including
  97.         attributes, sizes and times:
  98.  
  99.            doslfnbk c:\ /all
  100.            doslfnbk /l
  101.  
  102. 2. Description:
  103.  
  104.         Microsoft's Windows 95 introduced long filenames (LFNs), and
  105.         they are mostly compatible with old software.  However, there
  106.         are some problems.  Old backup programs don't recognize LFNs, so
  107.         they don't get properly backed up. Worse, the Win95 backup
  108.         program didn't support a lot of common backup hardware (e.g. the
  109.         Colorado Memory Systems tape drive using an accelerator card
  110.         that I owned) and wouldn't run in DOS mode, so recovery from a
  111.         catastrophic disk failure was really difficult.
  112.  
  113.         To address this problem, Microsoft put a program called
  114.         LFNBK on the Win95 CD ROM to back up your LFNs. However, it's
  115.         very inconvenient to use. It requires changes to your Control
  116.         Panel settings before and after use, and it works by stripping
  117.         all the LFNs off your disk --- so you need to restore them again
  118.         after you've done your backup to tape.  It will only run after
  119.         Win95 has booted, so again you've got big problems after a
  120.         catastrophic disk failure.
  121.  
  122.         If you've got a program that is completely incompatible with
  123.         LFNs then you might want to use LFNBK, but for routine system
  124.         backups it's too much of a pain.
  125.  
  126.         I wrote DOSLFNBK to address these problems.  It runs in any
  127.         version of DOS that can see your disk, and can both backup and
  128.         restore your files there.  During backup, it makes no changes to
  129.         the names, so you can routinely run it just before a tape backup
  130.         and not have to undo the damage afterwards.  It also allows
  131.         partial backups and partial restores; I'm pretty sure LFNBK is
  132.         an all-or-nothing affair.
  133.  
  134.         The downside of DOSLFNBK is that it has to work on the disk
  135.         below the file system level.  This means that it needs to lock
  136.         the disk to make sure no other programs are writing to the disk
  137.         while it is running.  This may cause errors in the other
  138.         programs; I recommend shutting them down before running
  139.         DOSLFNBK, or running it in a single-tasking DOS session.
  140.  
  141. 3. Details:
  142.  
  143.    Contents of this section:
  144.  
  145.           - what DOSLFNBK does
  146.           - what is in the backup file
  147.           - how to specify which directory to back up
  148.           - how to specify which directory to restore from
  149.           - existing long filenames and the /o option
  150.           - date information
  151.           - changed files
  152.           - file attributes and the /na and /nf options
  153.           - the /q quiet option, /v verbose option and the /d debug option
  154.           - the /all option to back up all filenames
  155.           - the /auto and /force options
  156.           - the /orphans option for damaged directories
  157.           - the /h option for high-level access
  158.           - the /s option to skip directories
  159.           - the LOCK and UNLOCK commands
  160.           - the irritating jump to full screen
  161.           - DOSLFNBK, disk defragmenters and directory sort utilities
  162.           - DOSLFNBK and XCOPY
  163.           - exit codes
  164.  
  165.  
  166.    - what DOSLFNBK does
  167.  
  168.         When doing a backup, DOSLFNBK reads the directories on the disk
  169.         and writes copies of all of the LFN records to the binary
  170.         BACKUP.LFN file (or whatever file you specify with /f).  If you
  171.         use the /nr option, it will work only on the specified
  172.         directory; otherwise, it saves those entries as well as
  173.         everything in any subdirectory below it.
  174.  
  175.    - what is in the backup file
  176.  
  177.         DOSLFNBK stores a full copy of the directory record for each
  178.         backed up file.  You can see this information by using the /l
  179.         option to list the file. It also keeps a record of which version
  180.         of DOSLFNBK was used to produce the backup, and what command
  181.         line arguments were used.  You can see this information by
  182.         TYPEing the backup file, or using the /V option when reading it.
  183.  
  184.    - how to specify which directory to back up
  185.  
  186.         Relative directory specifications are supported, and DOSLFNBK
  187.         understands SUBST to some extent.  (I believe it's possible with
  188.         a complicated network of SUBST, JOIN, etc. to confuse it; don't
  189.         do that!)
  190.  
  191.         The directory name itself won't be backed up or restored; only
  192.         the files and subdirectories within it. There is no way to
  193.         specify a subset of the files; you have to use the /p prompting
  194.         option if you want this.
  195.  
  196.         The original drive letter is not stored in BACKUP.LFN, so you
  197.         can use DOSLFNBK to save the long filenames on one drive, use a
  198.         DOS utility to move them to another drive, and then restore the
  199.         filenames there.
  200.  
  201.    - how to specify which directory to restore from
  202.  
  203.         By default DOSFLBNK will restore to the same
  204.         full path as was originally backed up.  To restore to a
  205.         different target directory, use the /from option.  The name
  206.         given in the /from option should be the original directory name
  207.         fully specified in 8.3 format, with no drive letter.  For
  208.         example, if you back up E:\OriginalDir, you should restore using
  209.         the option "/from \ORIGIN~1".  If you forget the 8.3 form, use
  210.         the /L option to list the backup file to see it.
  211.  
  212.    - existing long filenames and the /o option
  213.  
  214.         DOSLFNBK will normally not overwrite an existing LFN with a
  215.         different one; you should rename the file to its 8.3 alias
  216.         before running if you want to restore an old name, or run with
  217.         the /p option for individual prompting, or the /o option to
  218.         force overwrites.  These two options are mutually exclusive.
  219.  
  220.         Some DOS versions (e.g. Hebrew DOS) store special characters for
  221.         short filenames in records that are identical to long filename
  222.         records.  To restore the true long filenames in these DOS
  223.         versions, you *must* use either the /p or the /o option.
  224.         Similarly, Win95 sometimes generates LFNs when you copy files
  225.         with special characters (e.g. accented letters).  If you have
  226.         moved or manipulated these files in Win95, you'll need to
  227.         overwrite these generated LFNs.
  228.  
  229.         Win95 sometimes creates LFNs for files with special characters
  230.         in the names, even if the name is otherwise pure 8.3 form.  I
  231.         suspect this is to allow compatibility across code pages:  the
  232.         LFN will use the Unicode character encoding, while the 8.3
  233.         record depends on the code page.  DOSLFNBK will handle these
  234.         properly for code page 437 (the standard US code page), but it
  235.         may fail to restore some filenames containing special characters
  236.         in other code pages, because it will think they are valid LFNs.
  237.         Use /p or /o to force a restore of these names as well.
  238.  
  239.    - date information
  240.  
  241.         Normally, DOSLFNBK will restore the backed up date information,
  242.         since older DOS versions and DOS utilities probably don't save
  243.         this properly.  You can override this behaviour by using the /nt
  244.         switch.
  245.  
  246.    - changed files
  247.  
  248.         If during a restore, DOSLFNBK detects that the file size has
  249.         changed, you'll be prompted as to whether you want to restore
  250.         the LFN or not.  If you choose to restore it, the date
  251.         information will *not* be restored, as it is probably incorrect.
  252.  
  253.    - file attributes and the /na and /nf options
  254.  
  255.         Many backup programs don't handle Win95 file attributes properly.
  256.         They will skip hidden files or hidden directories, or change the
  257.         attributes upon restore.  Since some of the special features of
  258.         directories in Win95 depend on the attributes, this can cause
  259.         problems after a restore.  To avoid this, DOSLFNBK does two
  260.         things:  First, it checks that every directory and file recorded
  261.         in the backup file exists during the restore.  If any are
  262.         missing, it prints a warning message.  To skip this check, use
  263.         the /nf (no full restore) option.
  264.  
  265.         The second thing done to protect against attribute-challenged
  266.         programs is to store information on files with any unusual
  267.         attributes, whether they have long filenames or not.  These
  268.         include System, Hidden and Readonly files and directories, and
  269.         also files using two directory attribute bits that are not
  270.         normally used. During a restore, DOSLFNBK will restore any
  271.         attribute bits except the SubDirectory and Volume attributes
  272.         (because changing these would damage the disk structure) and the
  273.         Archive attribute (because this is typically used to signal
  274.         whether a file is backed up or not; one would expect it to
  275.         change after a backup).
  276.  
  277.         If you don't want this special handling of attributes, use the
  278.         /na option.  Only long filename records will be backed up, and
  279.         during a restore the file attributes of the file on the disk
  280.         will be kept.
  281.  
  282.    - the /q quiet option, /v verbose option and the /d debug option
  283.  
  284.         To show you the progress of a run, DOSLFNBK prints a dot for
  285.         about every 10 directories examined or (in /v mode) prints the
  286.         directory and file names.  If it stops printing for more than a
  287.         few seconds, something is probably wrong.  Try running again
  288.         with the /d debug log option, and if it stops again, please
  289.         email me (dmurdoch@pair.com) a copy of your log, along
  290.         with a description of your system.  I'm very interested in
  291.         making DOSLFNBK as bug-free as possible.
  292.         
  293.         During a restore, it normally prints a report of any changes made;
  294.         with the /q option this report is suppressed.
  295.  
  296.    - the /all option to back up all filenames
  297.  
  298.         Sometimes you may want a record of the names of every file on
  299.         the disk.  An easy way to get this is to run DOSLFNBK with the
  300.         /all option.  This will save the directory descriptions of every
  301.         file and subdirectory on your disk.  To view the listing, run
  302.         again with the /l option.  You can also make use of this during
  303.         the restore to detect files that have changed since the backup,
  304.         or files that were missed in a restore.
  305.  
  306.    - the /auto and /force options
  307.  
  308.         The /force option tells DOSLFNBK to go ahead without stopping
  309.         for several different warnings (e.g. overwriting the backup
  310.         file).  Use it in a batch file only when you're sure you always
  311.         want it to go ahead. The /auto option is the safe equivalent:
  312.         it acts as though you accepted the default.  In most cases,
  313.         the default is to abort the run; however, when restoring
  314.         a filename to a file that appears to have changed, the default
  315.         is to skip the file.
  316.  
  317.    - the /orphans option for damaged directories
  318.  
  319.         When damage occurs to a directory (perhaps by an old non-Win95
  320.         compatible program), often the long filename records are left
  321.         "orphaned":  they are no longer connected to any file.  When
  322.         this happens, the best thing to do is to use a disk repair
  323.         program (e.g. SCANDISK) to repair the damage before running
  324.         DOSLFNBK, because DOSLFNBK is written under the assumption that
  325.         the disk structure is intact.  
  326.  
  327.         DOSLFNBK makes an attempt to detect orphaned LFNs, and is 99%
  328.         successful.  When it detects any, it will stop and ask you
  329.         whether to continue the operation (the default response is No).
  330.         If you choose to continue a backup, then it will just skip over
  331.         the orphans, and back up everything else.  If you choose to
  332.         continue a restore, it will delete the orphaned records.
  333.         If there is other damage to your disk, it is possible that these
  334.         actions are *not* desirable, and may result in an incomplete or
  335.         unusable backup, or further damage to your disk on a restore.
  336.  
  337.         If you have a lot of damage to your disk and are just trying to
  338.         salvage what you can, you may not want to have to answer Yes to
  339.         all those questions.  In that case, you can use the /orphans
  340.         option, which will make DOSLFNBK go ahead regardless of the
  341.         consequences.
  342.  
  343.         In case it is not clear:  I would personally never use the
  344.         /orphans option, and would almost never answer Yes if orphans
  345.         were detected.  If you do this and your disk ends up in a mess,
  346.         you've only yourself to blame.
  347.  
  348.         What you *should* do is avoid orphans in the first place:  if
  349.         you detect orphans somehow, stop using whatever program created
  350.         them.
  351.  
  352.    - the /h option for high level access
  353.     
  354.         Normally DOSLFNBK uses low level methods to access the directory
  355.         structure during a backup.  This requires that the drive be 
  356.         using a FAT file system of some sort, and be locally connected.
  357.         The /h option tells DOSLFNBK to use high level methods instead:
  358.         this allows it to work on non-FAT disks, or over a network.
  359.         
  360.         Unfortunately, this option only works on backups; there is no way
  361.         to do a restore with such a disk.  Another restriction is that the
  362.         methods only work while Windows is running to provide high level
  363.         long filename services.
  364.  
  365.    - the /s option to skip directories
  366.  
  367.         The /s option tells DOSLFNBK to skip the back up or restore of a
  368.         particular directory.  This is meant as a workaround for the
  369.         memory limitations in DOSLFNBK that are described in section 4
  370.         below.  You can use /s as often as necessary to skip multiple
  371.         directories--the only limit is the command line length.  Note
  372.         that the directory name must be specified using the short
  373.         aliases, e.g. "\PROGRA~1" instead of "\Program files".  Relative
  374.         directory paths using "." and ".." are not supported.  If used
  375.         in combination with the /from option, you should specify the
  376.         *original* path name to skip, not the current one.
  377.  
  378.    - the LOCK and UNLOCK commands
  379.  
  380.         Previous versions of DOSLFNBK used the DOS LOCK and UNLOCK
  381.         commands to lock the disk and prevent errors during restores.
  382.         The current version does this internally.  If you have an old
  383.         batch file that runs LOCK, you'll get warning messages:  "Unable
  384.         to lock drive X:".  Just remove LOCK from the batch file and the
  385.         warnings will go away.
  386.  
  387.    - the irritating jump to full screen
  388.  
  389.         There is one bug in Win95 that the internal locking shows up:
  390.         if you try to restore LFNs to a disk that has any open files on
  391.         it while in a DOS window, the window will suddenly switch to
  392.         full screen.  I don't know of any way to prevent this.
  393.  
  394.    - DOSLFNBK, disk defragmenters and directory sort utilities
  395.  
  396.         You may be tempted to use an older DOS-based disk defragger or
  397.         directory sort utility that doesn't understand long filenames,
  398.         and then use DOSLFNBK to restore the long filenames.  DON'T DO
  399.         THIS! It is extremely likely to cause errors to your directory
  400.         structure which can't be repaired except by hours and hours of
  401.         work.  The problem is that these programs usually leave a few
  402.         files with wrong but apparently correct long filenames.  You'll
  403.         find that 90-95 percent of your disk is restored, but some
  404.         number of files are not.  It is extremely difficult and time
  405.         consuming to find and repair these files.  If you want to use
  406.         these DOS-based programs, you should remove all long filenames
  407.         first (e.g. using LFNBK, or by restoring from tape in DOS).  A
  408.         better solution is to use Win95 compatible versions of these
  409.         utilities.  (Win95 comes with a defragger, and there are shareware
  410.         directory sort utilities available, including mine,
  411.         available in ftp://garbo.uwasa.fi/pc/dirutil as lfnsrt??.zip.)
  412.  
  413.    - DOSLFNBK and XCOPY
  414.  
  415.         I have received several messages from people who have tried to
  416.         use XCOPY and DOSLFNBK to back up their disk to a network drive
  417.         or elsewhere, and then found on restore that Win95 won't boot
  418.         properly.  What appears to be the problem is that the 16 bit
  419.         version of XCOPY does not handle file and directory attributes
  420.         properly.  DOSLFNBK will restore missing attributes, but if a
  421.         file is not there, all it can do is warn you.  As far as I know
  422.         the only way to successfully use XCOPY in a backup scheme is
  423.         with a complicated batch file to remove special attributes
  424.         before the backup.  More details are given in the file
  425.         XCOPY.TXT, which contains messages from several people about
  426.         this problem.
  427.  
  428.    - exit codes
  429.  
  430.         When a run is successful, DOSLFNBK exits with ERRORLEVEL 0.
  431.         When something goes wrong, it prints an error message and exits
  432.         with a higher errorlevel. The currently defined error levels
  433.         are:
  434.  
  435.         99 - Syntax error
  436.         98 - Disk init error
  437.         97 - Disk read error
  438.         96 - Disk write error
  439.         95 - Disk directory error
  440.         94 - Directory init error
  441.         92 - Disk lock error
  442.         91 - Internal error
  443.         89 - Memory error
  444.         88 - Multitasker error
  445.         87 - Overwrite error
  446.         86 - Debug error
  447.         85 - Backup read error
  448.         84 - Backup write error
  449.         83 - Backup open error
  450.         82 - Backup close error
  451.         81 - Some directories were skipped because of low memory
  452.         80 - DOSLFNBK detected an error in the LFN structure on your
  453.              disk.  You should run SCANDISK or another disk repair
  454.              program to do repairs.
  455.  
  456. 4. Memory Limitations:
  457.  
  458.         When running, DOSLFNBK keeps copies of several directories in
  459.         memory at once.  It is written as a real mode DOS program and
  460.         keeps all of this data in the low 640K of memory.  This means
  461.         that in a typical DOS session with 500K of memory available,
  462.         DOSLFNBK will run out of memory when about 15,000 directory
  463.         entries are in memory.  On a restore, up to 3 copies of each
  464.         directory entry may be in memory at once, limiting DOSLFNBK to
  465.         disks with fewer than 5000 directory entries in any branch of
  466.         the directory tree.  (The total number of files on the disk
  467.         doesn't matter; what matters is the number of entries in a
  468.         directory, its parent, grandparent etc., back to the root.)
  469.  
  470.         When I wrote DOSLFNBK, I thought disks approaching this limit
  471.         were very unusual. However, it *is* possible to have such a disk,
  472.         and here's how to find out if you do:
  473.  
  474.         Run your backup with the /V verbose option.  At the end, it
  475.         will print a message something like
  476.  
  477.            Used 255K; restore will require about 264K in DOS session.
  478.  
  479.         If the amount of memory estimated for the restore is more than
  480.         you have available (as reported by the DOS MEM command), you
  481.         might have problems.  You might not; the number reported is
  482.         usually an overestimate.
  483.  
  484.         If it ever turns out that you do run out of memory during a
  485.         restore, you can still restore the LFNs by breaking up the
  486.         restore operation into several steps, restoring different parts
  487.         of your subdirectory tree separately.  In the worst case (more
  488.         than 5000 entries in a single subdirectory), you may have to
  489.         temporarily move files out of the directory and restore the LFNs
  490.         a few thousand (!!) at a time.
  491.  
  492.         Since the original release, it has become clear that there are
  493.         some common situations leading to very large directories. The
  494.         Microsoft Plus! package includes one, and WWW browsers often
  495.         create them while maintaining caches or history lists.
  496.         Unfortunately, the current version of DOSLFNBK doesn't handle
  497.         these very well; it just skips these directories and prints a
  498.         warning message and sets an error level on exit.  I have added
  499.         the /s option to allow you to skip particular directories during
  500.         the backup or restore operation.  A better solution that allows
  501.         all directories to be backed up is in the works.
  502.  
  503. 5. Safety:
  504.  
  505.         DOSLFNBK works with your disk at a level below the file system,
  506.         so if things go wrong during an LFN restore, it's conceivable
  507.         that you could lose whole files or directories.  I've tried to
  508.         make it as safe as I can, but you should follow some simple
  509.         precautions:
  510.  
  511.           - Run Scandisk before DOSLFNBK and get it to fix any errors.
  512.           In particular, if you've run other low level software (e.g. a
  513.           defragger or a directory sorter) that may have messed up the
  514.           LFNs, run Scandisk first.  Better still:  don't use that old
  515.           defragger/directory sorter, because Scandisk may not be able
  516.           to repair all the damage it does.
  517.  
  518.           - Don't turn off or reboot your PC in the middle of a DOSLFNBK
  519.           run.  If there's a power failure or (horrors!) a bug in
  520.           DOSLFNBK forces you to reboot, then Scandisk should be able to
  521.           repair much of the damage.  You may lose some filenames, but
  522.           Scandisk should be able to recover the files themselves.
  523.  
  524.           - If you hit Ctrl-Break or Ctrl-C during a DOSLFNBK restore,
  525.           it shouldn't do any damage other than giving you only a
  526.           partial restore of your LFNs --- but this is *not* a
  527.           well-tested feature, and there may be conditions under which
  528.           you'll suffer worse damage.  Again, Scandisk should be able to
  529.           repair most of it.
  530.  
  531.           - DOSLFNBK  was written for version 4.00.950 of Windows 95
  532.           (the August 1995 release).  It has been tested on versions up
  533.           to 4.00.950 B (the OSR2 release with FAT32 support), but not
  534.           on later versions, or on Win98 or Win NT (though I have heard
  535.           reports of successful use on both of those).  If the VFAT file
  536.           structure isn't what <TT>DOSLFNBK</TT> is written for, it
  537.           could do some real damage.
  538.  
  539.           - There is a known glitch under some Windows releases:  you
  540.           may get Windows error messages if you try to do a restore in a
  541.           Win95 window; if so, you should reboot in DOS mode and redo
  542.           the restore.
  543.  
  544.           - There may be special conditions on your system that DOSLFNBK
  545.           doesn't handle.  If you can, try it out when you've got a good
  546.           second backup to make sure it works.  If it doesn't, *please*
  547.           send me details, and I'll attempt to fix it.
  548.  
  549. 6. Recovery from total disk failure:
  550.  
  551.         If your boot disk fails, or you decide to repartition it, then
  552.         you may need to do a full restore from a backup tape.
  553.         Unfortunately, the Win95 backup program provides *no way* to do
  554.         this without re-installing Win95 from the original disks or CD
  555.         ROM.  From reports I've heard, the same is true of most other
  556.         commercial backup programs.
  557.  
  558.         However, if you have a reliable DOS-based backup program,
  559.         DOSLFNBK will let you do a complete restore from a backup.  I've
  560.         only had to do this twice, so these instructions aren't
  561.         guaranteed to cover everything for every system, but they worked
  562.         on mine.
  563.  
  564.         ADVANCE PREPARATIONS:
  565.  
  566.         Before your disk fails (i.e. right now! :-), you need to prepare
  567.         the following:
  568.  
  569.           1. A Win95 startup disk.  If you didn't create one when you
  570.           installed Win95, start the Add/Remove Programs option in
  571.           Control Panel, and click the Startup Disk tab. Then click the
  572.           Create Disk button, and follow the instructions on-screen.
  573.  
  574.           2. A copy of your DOS-based backup/restore program on a floppy
  575.           disk.  It may require EMS memory; if so, you should put
  576.           HIMEM.SYS and EMM386.EXE on your startup disk, and load them
  577.           via CONFIG.SYS.
  578.  
  579.           3. If you use Drivespace disk compression, then you should also
  580.           make sure that the MINI.CAB file from the installation disks
  581.           or the CD ROM is in your Windows directory on the hard disk.
  582.  
  583.           4. A full backup of your disk(s).  Just before creating this,
  584.           run DOSLFNBK to save all of your long filenames.  You'll need
  585.           to create one backup file for each disk.  It's fine to leave
  586.           this on the hard disk so that it ends up on the backup; you
  587.           don't need to have it on floppy disk.
  588.  
  589.         WHEN YOUR DISK FAILS:
  590.  
  591.         Depending on the reason for your disk failure, you may be able
  592.         to skip some of the early steps here.  Read them over, and
  593.         figure out where to start.  If you have to, you can start again,
  594.         so the only thing you lose by starting too far down is time.
  595.  
  596.           1. Make any necessary repairs to your hardware.
  597.  
  598.           2. Boot from your Startup disk, and use FDISK to partition
  599.           your disk.  Use "FORMAT c: /s" to reformat the disk and
  600.           transfer the system files to it.
  601.  
  602.           NOTE:  If you want to maintain the ability to boot to your old
  603.           DOS version, I've been told that the Startup disk's FDISK will
  604.           cause problems for you.  You should boot the old DOS version
  605.           and use its FDISK to partition your disk, and then reboot from
  606.           the startup disk and use "SYS c:" to transfer the Win95 system
  607.           files.  After that, you can continue as before.
  608.  
  609.           3. (Optional) Transfer your tape backup software to your hard
  610.           disk.
  611.  
  612.           4. If you're not planning to use Drivespace, you can skip down
  613.           to step 8.
  614.  
  615.           5. If you want to compress your drive, you need to restore
  616.           enough of Win95 to run Drivespace.  Don't restore the whole
  617.           disk; you might not have room for it.  For most people,
  618.           restoring the files in the root directory and the files in the
  619.           Windows directory should be enough.  If you have any essential
  620.           drivers in other directories, you'll need to restore them too.
  621.           Finally, you should restore DOSLFNBK and the data file(s)
  622.           containing the backed up long filenames.
  623.  
  624.           IMPORTANT:  You should not overwrite IO.SYS, but you *should*
  625.           overwrite MSDOS.SYS.  It is a hidden read-only file in your
  626.           root directory.  A good way is to erase MSDOS.SYS before
  627.           starting the restore (use ATTRIB from the Startup disk to
  628.           remove the System, Hidden, Read-only attributes), and then
  629.           tell your restore program not to overwrite existing files.
  630.  
  631.           Restore all those files now.
  632.  
  633.           6. Restore the long filenames by running
  634.  
  635.              DOSLFNBK c:\ /R /V /F backupfilename
  636.  
  637.           7. Remove the Startup disk, and reboot your system.  You may
  638.           get some errors about missing drivers (e.g. no sound card
  639.           drivers), but things should basically work.  Run DriveSpace to
  640.           compress your drives the way you want.
  641.  
  642.           8. Reboot your system in DOS mode or from the Startup disk.
  643.  
  644.           9. Restore all rest of the files on all of your disks from the
  645.           backup now.  See the "IMPORTANT" note in step 5 about
  646.           MSDOS.SYS and IO.SYS.
  647.  
  648.           10. Restore all the rest of your long filenames by running
  649.  
  650.              DOSLFNBK c:\ /R /V /F backupfilename
  651.  
  652.           and if you've also got a D: partition,
  653.  
  654.              DOSLFNBK d:\ /R /V /F backupfilename
  655.  
  656.           You may get messages about some long filenames already
  657.           existing from your first restore; don't worry about those.
  658.  
  659.           11. Some restore programs set the archive bit on all restored
  660.           files; you might want to turn it off (since you've still got
  661.           those files backed up) at this point.
  662.  
  663.         Reboot your system, and things should be back as they were when
  664.         you did your backup!
  665.  
  666. 7. License:
  667.  
  668.         DOSLFNBK is *not* public domain software.  Releases up to
  669.         version 1.6 were freeware, and you may use them at
  670.         no charge.  However, the current release is shareware.  You may
  671.         use it at no charge for an evaluation period
  672.         of 30 days only.
  673.  
  674.         You are free to distribute unmodified copies of the complete
  675.         DOSLFNBK package, provided your total charge is no more than $1.
  676.         The total cost of a compilation (e.g. a CD ROM) including
  677.         DOSLFNBK must be no more than $1 per package in the compilation.
  678.  
  679.         To continue to use DOSLFNBK beyond the 30 day evaluation period,
  680.         you must register it.  There are three possible registration
  681.         levels available:
  682.  
  683.           $10 simple registration + $5 handling charge
  684.  
  685.         This registration fee gives you a license to use one copy of
  686.         DOSLFNBK indefinitely.  If you include an email address when you
  687.         register I will notify you of new versions and how to obtain
  688.         them yourself. I'll also attempt to answer emailed questions
  689.         about DOSLFNBK from registered users. Payment may be made in
  690.         Canadian or US dollars (at par), or the UKP equivalent of $15
  691.         US.  NOTE:  See below for how to avoid the handling charge.
  692.  
  693.           $20 upgrade registration + $5 handling charge
  694.  
  695.         This registration fee also entitles you to use DOSLFNBK
  696.         indefinitely.  In addition to the license to use it, I will mail
  697.         you a diskette containing the latest version, together with a
  698.         collection of other freeware and (unregistered) shareware
  699.         programs that I have written (including LFNSORT).  If you send
  700.         an email address I will notify you of updates, and send one free
  701.         update by email if you request it.  Payment may be made in
  702.         Canadian or US dollars (at par), or the GBP (Sterling)
  703.         equivalent of $25 US.
  704.  
  705.           $45 source code registration + $5 handling charge
  706.  
  707.         DOSLFNBK was written in Borland Pascal 7.01, using the excellent
  708.         Object Professional library from TurboPower Software.  In
  709.         addition to the benefits of the upgrade registration, the source
  710.         code registration gives you the DOSLFNBK source code (including
  711.         an object-oriented low-level disk access unit, access to the new
  712.         Win95 DOS API functions, and a huge memory support unit, but not
  713.         OPro).  Payment may be made in Canadian or US dollars (at par),
  714.         or the GBP equivalent of $50 US.
  715.  
  716.         Any of the registrations can be done by sending a cheque or
  717.         money order to:
  718.  
  719.          Duncan Murdoch
  720.          354 Victoria St.
  721.          London, Ontario
  722.          N6A 2C8
  723.  
  724.         NOTE 1:  If you send a $10 simple registration order directly to
  725.         me at this address, I will waive the handling fee.  Send a
  726.         cheque or money order for $10 in Canadian or US dollars, or the
  727.         UKP equivalent of $10 US.
  728.  
  729.         You can also register or order source code from Digibuy.Com
  730.         using MC, Visa, AmEx, or Discover card online at
  731.  
  732.          http://www.digibuy.com/cgi-bin/order.html?40588+93636044388
  733.  
  734.         Digibuy is for ordering only.  I *cannot* be reached there.  To
  735.         contact me for information about dealer pricing, volume discounts,
  736.         site licensing, the status of shipment of the product, the latest
  737.         version number or for technical information, write to me at the
  738.         address above or the email address below.  I'd especially like to
  739.         hear bug reports and suggestions for improvements.
  740.  
  741.          Internet:   dmurdoch@pair.com
  742.  
  743. 8. Release history:
  744.  
  745.        0.0 - first beta test version
  746.        0.1 - kept file attributes of existing file during restore.
  747.        0.2 - made messages more informative; fixed bug in handling
  748.              erased file entries; added check of overwrite of backup
  749.              file; changed default name of backup file to BACKUP.LFN and
  750.              made LFN the default backup extension; added /P option.
  751.        0.3 - fixed memory leak that caused run-time error 203 on large
  752.              restore
  753.        0.4 - added check for successful write of backup file, added
  754.              /force option.
  755.        0.5 - added report of memory use, /d option, many debugging
  756.        messages
  757.        0.6 - cleaned up messages and debug log, removed disk size
  758.              restriction, added progress dots for non-verbose runs.
  759.        1.0 - first public release --- same as 0.6
  760.        1.1 - unauthorized release
  761.        1.2 - documentation changes and addition of /s option
  762.        1.3 - improved memory management, stopped use of obsolete DOS
  763.              service 1C, speeded up directory expansion on restore
  764.        1.4 - added /L option, support for relative path on command line,
  765.              internal drive locking, support for SUBST etc.  Changed
  766.              exit codes to be compatible with LFNSORT.
  767.        1.5 - public release, same as 1.4c
  768.        1.6 - fixed bug in handling volume labels
  769.        1.7 - added integrity checks of disk structure,
  770.              backup/restore/display of file attributes, checks for
  771.              existence of backed up files, changed from freeware to
  772.              shareware, /o option.
  773.        1.9 - fixed display of some special characters, added FAT32
  774.        support,
  775.              added /from and /all options, added support for non-IOCTL
  776.              drives
  777.        2.0 - fixed bug with FAT32 drives, bug with swapfile
  778.        2.1 - fixed bug with very large directories
  779.        2.2 - fixed confusing prompts, removed requirement for /L
  780.              directory to exist, changed backup format, restored support
  781.              for obsolete formats
  782.        2.3 - fixed bug with /force option and file size change, added
  783.              automatic packing of directories when short of space,
  784.              added /auto option.
  785.        2.4 - added /q and /h options.      
  786.        2.5 - fixed bugs with 64K clusters
  787.  
  788. 9. Acknowledgments
  789.  
  790.         The first version of DOSLFNBK was written based on the
  791.         information in Robert Hummel's article on Win95 long filenames
  792.         in the June/July 1995 issue of PC Techniques Magazine.  Thanks
  793.         are due to the beta testers, who suggested many improvements,
  794.         and several of whom were put to considerable inconvenience by
  795.         early versions that messed up their disks.  M. Guffey made a lot
  796.         of useful suggestions for improvements to the documentation.
  797.         Several people sent me details of working with XCOPY; some of
  798.         them are included here in the XCOPY.TXT file.